#ifndef ICP_H
#define ICP_H

#include <QDebug>

//Eigen library for SVD
#include <Eigen/Dense>


//Mesh definition
#include "core/engine/mesh_definition.h"


//Append function
#include<vcg/complex/trimesh/append.h>

class ICP
{

    public:
        ICP( CGMesh& s, CGMesh& t );

        Eigen::Matrix3f getRot();
        Eigen::Vector3f getTra();
        float getError();

        CGMesh* getShiftedTarget();
        void moveTarget();

    private:
        //sorce and target mesh (reference)
        CGMesh& source;
        CGMesh& target;
        //output (shifted target)
        CGMesh* output;
        //rotation, translation
        Eigen::Matrix3f rot;
        Eigen::Vector3f tra;

        //error
        float error;
};

#endif // ICP_H
